package design_pattern.chain.demo01;

/**
 * @version 1.0.0
 * Created by cyd on 2022-06-16 14:26:38
 * @ClassName : design_pattern.chain.demo01.Client
 * @Description : 类描述
 */
public class Client {

    public static void main(String[] args) {
        ConcreteHandler01 handler01 = new ConcreteHandler01();
        ConcreteHandler02 handler02 = new ConcreteHandler02();
        ConcreteHandler03 handler03 = new ConcreteHandler03();

        handler01.setSuccessor(handler02);
        handler02.setSuccessor(handler03);

        int[] requestArray = new int[]{2, 5, 14, 22, 18, 3, 27, 20};

        for (int request : requestArray) {
            handler01.handleRequest(request);
        }
    }
}
